<template>
  <div class="world">
    <world-box :worldData="worldData" v-loading="fullscreenLoading"></world-box>
    <nice-empty
      v-show="worldData.length == 0 && fullscreenLoading == false"
      :emptyText="$t('public.noData')"
    ></nice-empty>
  </div>
</template>

<script>
import worldBox from "@/components/common/worldBox/Index";
export default {
  data() {
    return {
      worldData: [], // 后端返回的数据
      //数据载入动画
      fullscreenLoading: true,
    };
  },
  components: {
    worldBox,
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    this.getRegionList();
  },
  methods: {
    //获取区域信息
    async getRegionList() {
      this.fullscreenLoading = true;
      try {
        let res = await this.$api.national.getRegionList({});
        if (res.code === 1000000) {
          this.fullscreenLoading = false;
          this.worldData = res.source ? res.source : [];
        } else {
          this.$message({
            showClose: true,
            message: res.data,
            type: "error",
          });
        }
      } catch (e) {
        console.log(e);
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.world {
  padding-top: 20px;
  border-top: 1px #eeeeee solid;
}
</style>
